package com.huawei.appgallery.assistantdock.buoydock.card.card;

import android.content.Context;
import android.view.View;
import com.huawei.appgallery.assistantdock.base.cardkit.bean.BuoyBaseCardBean;
import com.huawei.appgallery.assistantdock.base.cardkit.card.BuoyBaseCard;
import com.huawei.appgallery.assistantdock.buoydock.card.bean.BuoyLanternCardBeanBuoy;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import java.util.ArrayList;
import java.util.List;
import o.cgz;
import o.chy;
import o.ezo;
import o.ezs;
import o.fae;
import o.fam;

public class BuoyLanternCardBuoy extends BuoyBaseCard {
    protected chy ˋ;
    private List<BuoyBaseCard> ॱ = new ArrayList();

    public /* synthetic */ cgz ˏ(View view) {
        return ˋ(view);
    }

    public BuoyLanternCardBuoy(Context context) {
        super(context);
    }

    public BuoyBaseCard ˋ(View view) {
        ʽ(view);
        return this;
    }

    public BuoyBaseCard ˎ(int i) {
        if (this.ॱ == null || i < 0 || i >= this.ॱ.size()) {
            return null;
        }
        return (BuoyBaseCard) this.ॱ.get(i);
    }

    public void ˎ(BuoyBaseCard buoyBaseCard) {
        if (buoyBaseCard != null) {
            this.ॱ.add(buoyBaseCard);
        }
    }

    public void ˊ() {
        this.ॱ.clear();
    }

    public int ˋ() {
        return this.ॱ.size();
    }

    public void ˏ(CardBean cardBean) {
        int i;
        super.ˏ(cardBean);
        BuoyLanternCardBeanBuoy buoyLanternCardBeanBuoy = (BuoyLanternCardBeanBuoy) cardBean;
        if (buoyLanternCardBeanBuoy.ˊ() != null) {
            int size = buoyLanternCardBeanBuoy.ˊ().size();
            ˊ(buoyLanternCardBeanBuoy);
            i = size;
        } else {
            i = 0;
        }
        int ˋ = ˋ();
        String ˎ = ˎ();
        for (int i2 = 0; i2 < ˋ; i2++) {
            BuoyBaseCard ˎ2 = ˎ(i2);
            if (ˎ2 != null && (ˎ2 instanceof BuoyLanternItemCardBuoy)) {
                BuoyLanternItemCardBuoy buoyLanternItemCardBuoy = (BuoyLanternItemCardBuoy) ˎ2;
                if (i2 >= i) {
                    buoyLanternItemCardBuoy.ˉ().setVisibility(8);
                } else {
                    buoyLanternItemCardBuoy.ˉ().setVisibility(0);
                    CardBean cardBean2 = (BuoyBaseCardBean) buoyLanternCardBeanBuoy.ˊ().get(i2);
                    cardBean2.ˋˋ(cardBean.ॱˉ());
                    buoyLanternItemCardBuoy.ˋ(ˎ);
                    buoyLanternItemCardBuoy.ˏ(cardBean2);
                    buoyLanternItemCardBuoy.ॱ(this.ˋ);
                }
            }
        }
    }

    public void ॱ(chy o_chy) {
        this.ˋ = o_chy;
    }

    private void ˊ(BuoyLanternCardBeanBuoy buoyLanternCardBeanBuoy) {
        fae ˏ = fam.ॱ().ˏ();
        if (ˏ != null) {
            ezo ˋ = ezs.ˏ().ˋ(ˏ.getGameInfo());
            if (ˋ != null) {
                ˋ.ˏ(buoyLanternCardBeanBuoy);
            }
        }
    }
}
